import React = require("react");
import { PageProps } from "maishu-chitu-react";
import { DesignView } from "controls/design-view";
import { pageDatas } from "services/page-datas";
import { LocalService } from "services/local-service";
import { SpinerComponent } from "controls/spiner-component";
import { PageDataRecord } from "entities";

interface State {
    status?: "loading" | "complete"
    pageDataRecord: PageDataRecord
}

export default class StoreMemberPage extends SpinerComponent<PageProps, State> {
    localService: LocalService;
    constructor(props) {
        super(props);

        this.localService = this.props.createService(LocalService);
    }

    async loadData() {
        let pageDataRecord = await pageDatas.member();//defaultPageDatas.empty();
        return { pageDataRecord };
    }

    render() {
        let { pageDataRecord } = this.state || {} as State
        return <DesignView {...this.props} pageDataRecord={pageDataRecord} />
    }
}